/* 基本スタイル */
.menu {
  display: flex; /* メニュー全体を横並び */
  justify-content: space-around; /* 均等配置 */
  align-items: center; /* 高さを揃える */
}

.menu-item {
  display: inline-block;
  white-space: nowrap; /* 通常は1行にする */
  text-align: center;
  padding: 10px 15px; /* 余白調整 */
}

.menu-item.menu-item1 {
  display: flex; /* 中のテキストを縦配置に */
  flex-direction: column; /* 縦に並べる */
  /*font-size: 14px; /* 少し小さく */
  line-height: 0.6; /* 行間を詰める */ 
  text-align: center;
  /*max-width: 80px; /* 適切な幅にする */
}

.small-text {
  font-size: 12px; /* 「オリジナルチーム」だけ小さく */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background-image: url('header_bg_repeat.gif');
  background-repeat: repeat-x;
  background-position: top;
  background-color: #f4f4f4;
  font-size: 16px;
}

header {
  color: #fff;
  text-align: center;
  height: 80px; /* 高さを80pxに固定 */
  display: flex; /* Flexboxを使用 */
  align-items: center; /* 縦方向の中央揃え */
  justify-content: center; /* 水平方向の中央揃え */
  background-image: url('header_bg.jpg');
  background-repeat: no-repeat;
  background-position: top center;
}

h1 {
  font-size: 24px;
}
h2 {
  position: relative; /* 右端の画像の配置の基準にする */
  background-image: url('title_bg1.jpg'); /* 背景画像のパスを指定 */
  background-size: cover; /* 画像を幅いっぱいにカバーする */
  background-repeat: no-repeat;
  height: 68px; /* h2の高さを背景画像に合わせる */
  line-height: 68px; /* テキストを縦方向に中央揃え */
  padding-right: 40px; /* 右端の画像分のスペースを確保 */
  padding-left: 12px; /* テキストの左側のパディング（必要に応じて調整） */
  font-size: 24px;
  color: #000;
  margin:0;
}
h3 {
  width: 100%;
  background-color: #71b3d0; /* タイトルの背景色 */
  padding: 10px 20px;
  margin: 30px 0 0 0 ;
  box-sizing: border-box;
  color: #fff; /* タイトルの文字色 */
}
.h3article {
  width: 100%;
  background-color: #dcdcdc; /* 段落の背景色 */
  padding: 20px;
  margin: 0;
  box-sizing: border-box;
}
/* .h3article内のみPタグを調整 */
.h3article p {
  margin: 0;
  padding: 0;
}
h4 {
  width:100%;
  border-bottom:#000 solid 3px;
  text-align:center;
  margin:25px 0 10px;
  background:#006762;
  padding:10px 0;
  font-weight:bold;
  color:#FFF;
  background-position: center;
}
/* 横幅に合わせて縮小する */
img {
  vertical-align: middle; /* 必須　画像下の余白を削除 display: block;も使えるがtext-align: center;が使えなくなる*/
  max-width: 100%;  /* カラムの幅を超えないようにする */
  height: auto;    /* 縦横比を維持する */
}
/* pタグの次にimgタグが来た場合にだけimgにマージンを追加 */
 img + p {
  margin: 6px 0 20px !important;
}
/* テーブルの中の画像サイズは変えない */
table img {
  width: auto;
  height: auto;
  max-width: none;
}
/* テーブルスタイル */
table {
width: 100%;
border-collapse: collapse;
}
td {
padding: 10px;
vertical-align: middle; /* 縦方向の中央揃え */
}

/* 1列目のセルは折り返さず、強調（太字） */
td:nth-child(1) {
  width:1px;
  white-space: nowrap; /* 折り返しを防止 */
  font-weight: bold; /* 強調するために太字に設定 */
}

/* セルの背景色を交互に設定 */
td:nth-child(odd) {
background-color: #e8e8e8;
}

td:nth-child(even) {
background-color: #d6d6d6;
}

/* 行ごとに交互に色を適用 */
tr:nth-child(odd) td:nth-child(odd),
tr:nth-child(even) td:nth-child(even) {
background-color: #e8e8e8;
}

tr:nth-child(odd) td:nth-child(even),
tr:nth-child(even) td:nth-child(odd) {
background-color: #d6d6d6;
}

/* ページタイトルのキャラ */
.h2-char {
  position: absolute;
  right: 0; /* カラムのパディングに合わせて配置 */
  top: 0;
  width: 101px; /* 画像の幅を指定（必要に応じて変更） */
  height: 68px; /* 画像の高さを指定（必要に応じて変更） */
}

/* メニューエリア */
.menu-area {
  width: 100%;
  background-color: #006762;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 20px;
  box-sizing: border-box;
  border-top: 2px solid #262620;
}
/* メニューリンク */
.menu-link {
  display: none; /* 初期状態で非表示 */
  justify-content: center; /* 水平方向に中央揃え */
  cursor: pointer;
  color: white;
}
.menu {
  display: flex;
  flex-wrap: wrap; /* 折り返しを許可 */
  justify-content: center; /* 中央揃え */
  margin: -7.5px; /* 子要素のマージンの影響を打ち消すために負のマージンを追加 */
}
.menu-item {
  position: relative;
  display: inline-block;
  padding: 10px 18px;
  background-color: #fff;
  border-radius: 24px;
  white-space: nowrap;
  transition: background-color 0.3s;
  text-decoration: none;
  color: black;
  margin: 7.5px; /* 各アイテムの周りに7.5pxのマージンを設定してスペースを確保 */
}
.menu-item:hover {
  background-color: #fff100;
}
.menu-item.active {
  background-color: #00ba52;
  color: white;
}
/* メニューのNEW */
.new-badge {
  font-size: 12px;
  color: red;
  font-weight: bold;
  background-color: transparent;
  position: absolute;
  top: -3px;
  left: 14px;
  padding: 2px 4px;
  border-radius: 4px;
}

.container {
  display: flex;
  padding: 1rem;
}

main {
  width: 100%;
  max-width: 640px;
  background-color: #fff;
  padding: 20px;
  font-size: 16px;
}

footer {
  background-color: #006762;
  color: #fff;
  text-align: center;
  padding: 1rem;
}

/* 広告のスタイル */
.ad-article {
  margin-top: 40px;
}

/* スマホでのレイアウト */
@media only screen and (max-width: 767px) {
  /* メニューリンクを表示 */
  .menu-link {
    display: flex; /* スマホでは表示 */
  }

  /* h2 のフォントサイズを小さく */
  h2.small-title {
    font-size: 16px; /* スマホではフォントサイズを16pxに変更 */
  }

  /* 広告が縦に並ぶ */
  .container {
    flex-direction: column;
    align-items: center;
  }

  .ad-left, .ad-right {
    width: 100%; /* スマホでは広告が幅いっぱいに表示される */
    line-height: normal;
  }

  main {
    margin-top: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  /* メニューの縦並びと非表示設定 */
  .menu {
    display: none; /* 初期状態では非表示 */
    flex-direction: column; /* メニューを縦並び */
    margin-top: 10px;
  }

  .menu-area.active .menu {
    display: flex; /* メニューエリアがアクティブになったら表示 */
  }
}

/* タブレットでのレイアウト（768pxから1024px） */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
  .menu-link {
    display: none; /* タブレットとデスクトップでは非表示 */
  }

  .menu {
    display: flex; /* 常に表示 */
  }

  /* 広告が縦に並ぶ */
  .container {
    flex-direction: column;
    align-items: center;
  }

  .ad-left, .ad-right {
    width: 100%; /* スマホでは広告が幅いっぱいに表示される */
    line-height: normal;
  }

  main {
    margin-top: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

}

/* デスクトップでのレイアウト（1025px以上）（左右に縦長広告） */
@media only screen and (min-width: 1025px) {
  .menu-link {
    display: none; /* タブレットとデスクトップでは非表示 */
  }

  .menu {
    display: flex; /* 常に表示 */
  }

  .container {
    flex-direction: row;
    max-width: 960px; /* タブレットでは960pxの幅に固定 */
    margin: 0 auto; /* 中央に配置 */
  }

  .ad-left, .ad-right {
    width: 160px; /* 広告の幅を160pxに固定 */
    height: 600px;
    flex-shrink: 0; /* 幅が縮まないように固定 */
  }

  main {
    flex-grow: 1; /* 残りのスペースをすべて占有 */
    max-width: calc(100% - 320px); /* 広告エリアを除いた幅 */
    margin: 0; /* マージンを削除してくっつける */
    box-sizing: border-box; /* パディングなどのサイズを含める */
  }
}

/* デスクトップとタッチパネルの文章切り替え */
/* 縦向き（ポートレート）でのタブレットとスマホの表示 */
@media (max-width: 1024px) and (orientation: portrait) {
  .mobile-text {
      display: block;
  }
  .desktop-text {
      display: none;
  }
}
/* 横向き（ランドスケープ）でのタブレットとスマホの表示 */
@media (max-width: 1024px) and (orientation: landscape) {
  .mobile-text {
      display: block;
  }
  .desktop-text {
      display: none;
  }
}
/* デスクトップ（1025px以上） */
@media (min-width: 1025px) {
  .mobile-text {
      display: none;
  }
  .desktop-text {
      display: block;
  }
}
